<%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

	<script src = "../js/jquery-1.12.1.js" type = "text/javascript"></script>
	<script src = "../js/common.js" type = "text/javascript"></script>
	
	<link href="<%=request.getContextPath() %>/css/extremecomponents.css" rel="stylesheet" type="text/css" />
	<link href="<%=request.getContextPath() %>/css/global.css" rel="stylesheet" type="text/css" />
<title>Insert title here</title>
<body>
<script>
	
	
    $(function() {
        //查询
        $("#btnsearch").click(
            function() {
                formPost(window.SearchState, '','coursestudent?ActionType=course_student_manage', this);
            });
        //创建课程
        $("#btnadd").click(
            function() {
            	formPost(window.SearchState, '','coursestudent?ActionType=coursestudent_Add_Update_Init&FLAG=add', this);
            });
    });
    
  //删除课程
    function deleteClass(classId){
    	console.log(classId);
    		 var msg = "将删除与本班级相关的所有信息,请谨慎操作！"; 
    		 if (confirm(msg)==true){ 
    			 $.ajax({
    		            type : "post",
    		            dataType : "text",
    		            url : "coursestudent?ActionType=coursestudent_Delete",
    		            data : {"CLASS_ID":classId},
    		            success : function(massage) {
    		                if (massage == 'success') {
    		                	goTo("coursestudent?ActionType=course_student_manage");
    		                }else{
    		                	alert("删除课程信息失败！");
    		                }
    		            }
    		        });
    		 }else{ 
    		   return false; 
    		 } 
    }
</script>
<div id="current">当前位置：基础数据管理 &gt; 班级管理</div>
<form name="SearchState" method="get">
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="search_table">
    <tr class="search_title_tr">
      <td colspan="4" class="search_title_L"><img src="../images/search_titleleft.jpg" width="84" height="30" align="top" /></td>
      <td width="25%" class="search_title_R"><img src="../images/search-titleright.jpg" width="8" height="30" align="top" /></td>
    </tr>
    <tr>
      <td width="12%" class="search_td1">班级名：</td>
      <td width="25%" class="search_td2">
        <input name="CLASS_NAME" type="text" size="16" value="<c:out value="${CONDITIONMAP.className}" />" />
      </td>
      <td width="12%" class="search_td1">总人数：</td>
      <td colspan="2" class="search_td2">
        <input name="NUMBER" type="text" size="16" value="<c:out value="${CONDITIONMAP.number}"/>" />
      </td>
    </tr>
    <tr>
      
      
      <td class="search_td2">
      <input id="btnsearch" name="btnsearch" type="button" class="btn_2" value="查询" />
      <input id="btnadd" name="btnadd" type="button" class="btn_4" value="新建班级" /></td>
    </tr>
  </table>
  </form>
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td class="search_shadow"></td>
    </tr>
    <tr>
        <td class="main_blank"></td>
    </tr>
</table>
<!--数据列表-START-->
<ec:table items="CLASSINFO" var="row"
    action="coursestudent?ActionType=course_student_manage"
    view="html" 
    autoIncludeParameters="false"
     >
    <ec:exportXls fileName="courseList.xls" />
    <ec:row>
        <ec:column style="text-align:center;" width="7%" property="rowcount" cell="rowCount" title="序号" sortable="false"/>
        <ec:column property="course_class_name" style="text-align:center;" title="班级名称" />
        <ec:column property="number" style="text-align:center;" title="总人数" />
        <ec:column property="chose_course_teacher_id" style="text-align:center;" escapeAutoFormat="true" sortable="false" title="任课老师" />
         
        <ec:column property="EDIT" style="text-align:center;" title="操作" viewsDenied="xls">
        	<a href="#" onClick="formPost(window.SearchState,'','coursestudent?ActionType=coursestudent_Add_Update_Init&FLAG=update&CLASS_ID=<c:out value="${row.course_class_id}"/>',this);">修改</a> |

		   	 <a href="#" onClick="deleteClass('<c:out value="${row.course_class_id}"/>')">删除</a>
        
        </ec:column>
    </ec:row>
</ec:table>
</body>
</html>